"""
读取2-304所有文件
"""
import os

address = r'C:\Users\Lenovo\Desktop\txt2'
address = address + "\\"

#定义txt存放所有txt文件
allFileTxt = open(r"C:\Users\Lenovo\Desktop\txt2\allTxt.txt",'w+',encoding="UTF-8")

Allword = open(r"E:\project_python\NewN\words.txt",'r+',encoding="UTF-8")

testFile = open(r"E:\project_python\NewN\NLP\testFile.txt",'r',encoding="UTF-8")
#打开2-304文件
"""
慎用 运行就会清零
"""
def readAllfiles():
    fileaddress = ""
    for i in range(2,305):
        #拼接地址
        fileaddress = address + str(i) + r".txt"
        if(os.path.exists(fileaddress)):
            File = open(fileaddress,'r',encoding="UTF-8")
            for lines in File.readlines():
                lines = lines.strip()
                print(lines,file=allFileTxt)
readAllfiles()

def test():
    for i in testFile.read():
        print(ord(i))
# test()